﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Inbox.Forms
{
    public partial class ParentForm : Form
    {
        public ParentForm()
        {
            InitializeComponent();
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            this.mainMenu.Visible = false;
            this.InitializeEvents();
        }

        private void InitializeEvents()
        {
            this.Load += new EventHandler(ParentForm_Load);
        }

        private void ParentForm_Load(object sender, EventArgs e)
        {
            LoginForm frmLogin = new LoginForm();
            frmLogin.FormClosing += new FormClosingEventHandler(frmLogin_FormClosing);
            frmLogin.MdiParent = this;
            frmLogin.Show();
        }

        private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
        {
            LoginForm frmLogin = sender as LoginForm;
            if (frmLogin == null) return;

            if (frmLogin.IsLogin)
                this.mainMenu.Visible = true;
        }

        private void thêmVâtTưToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void tspAddMachine_Click(object sender, EventArgs e)
        {

        }

        private void tsmCreatePlanning_Click(object sender, EventArgs e)
        {
            frmCreatePlanning frmCreatePlanning = new frmCreatePlanning();
            frmCreatePlanning.MdiParent = this;
            frmCreatePlanning.Show();
        }

        private void tslExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
